<div>
    <div class="fields clearfix">
        <a href="<?php echo $this->Html->url("/admin/websites/add/".$user_id); ?>" class="butDef">Add New website</a>
    </div>
<table cellpadding="0" cellspacing="0" border="0" id="table" class="uiTable">
<tr>
	
    <th><h3><?php echo $paginator->sort('website_name');?></h3></th>
   <?php if(!isset($select_user)){?> <th><h3><?php echo $paginator->sort('user_id');?></h3></th><?php }?>
    <th><h3><?php echo $paginator->sort('domain');?></h3></th>
    <th><h3><?php echo "Actions";?></h3></th>

	
</tr>
<?php
$i = 0;
foreach ($websites as $website):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}
?>
	<tr<?php echo $class;?>>
		<td>
			<?php echo $website['Website']['website_name']; ?>
		</td>
                <?php if(!isset($select_user)){?> 
                <td>
			<?php echo $website['User']['user_name']; ?>
		</td>
                 <?php }?>
		<td>
			<?php echo $website['Website']['domain']; ?>
		</td>
                <td>
                    <?php echo $html->link(__('Keywords', true), array('controller'=>'keywords','action' => 'admin_index', $website['Website']['id'])); ?>&nbsp;&nbsp;
                    <?php echo $html->link(__('Edit', true), array('controller'=>'websites','action' => 'admin_edit/'.$website['Website']['user_id'], $website['Website']['id'])); ?>&nbsp;&nbsp;
                    <?php echo $html->link(__('Delete', true), array('controller'=>'websites','action' => 'admin_delete/'.$website['Website']['user_id'], $website['Website']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $website['Website']['id'])); ?>


                </td>
	</tr>
<?php endforeach; ?>
</table>
</div>
<?php echo $this->element('paging') ?>